CreateProjectFromTemplateServiceglobal with sharing class CreateProjectFromTemplateService a service used to clone one or more projects from templates. you can use this service in conjunction with sobjectclonemapper, as the mappers on a clone request, to add extra fields to objects or extra objects that are copied from the template. You must include the fields describing the relationship between extra objects and the template project. Methods
createProjectsFromTemplatesglobal static List<CreateProjectFromTemplateService.CreateProjectResponse> createProjectsFromTemplates(List<CreateProjectFromTemplateService.CreateProjectFromTemplateRequest> requests) This method creates new projects from a project template using details provided in the CreateProjectFromTemplateRequest list. The following configuration is used: Input Parameters
Return ValueThis service returns CreateProjectResponses in a list that parallels the input list. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code createProjectsFromTemplatesglobal static List<CreateProjectFromTemplateService.CreateProjectResponse> createProjectsFromTemplates(List<CreateProjectFromTemplateService.CreateProjectFromTemplateAndAccountRequest> requests) This method creates new projects from a project template using details provided in the requests list. The project will be linked to the account Id passed in the CreateProjectFromTemplateAndAccountRequest. The following configuration is used: Input Parameters
Return ValueThis service returns CreateProjectResponses in a list that parallels the input list. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code createProjectsFromTemplatesglobal static List<CreateProjectFromTemplateService.CreateProjectResponse> createProjectsFromTemplates(List<CreateProjectFromTemplateService.CreateProjectFromTemplateAndOpportunityRequest> requests) This method creates new projects from a template project using details provided in the CreateProjectFromTemplateAndOpportunityRequest list. The project will be linked to the opportunity Id passed in the CreateProjectFromTemplateAndOpportunityRequest. The following configuration is used: Input Parameters
Return ValueThis service returns CreateProjectResponses in a list that parallels the input list. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code CreateProjectFromTemplateService.CreateProjectRequestglobal abstract class CreateProjectRequest the request structure for the createprojectfromtemplateservice. Properties
CreateProjectFromTemplateService.CreateProjectFromTemplateRequestglobal with sharing class CreateProjectFromTemplateRequest extends CreateProjectRequest the request structure for creating projects from templates only. to be used with createprojectsfromtemplates. This class extends CreateProjectFromTemplateService.CreateProjectRequest MethodsCreateProjectFromTemplateRequestglobal CreateProjectFromTemplateRequest(Id templateProjectId, Date startDate) A default constructor with minimum required properties. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code CreateProjectFromTemplateService.CreateProjectFromTemplateAndAccountRequestglobal with sharing class CreateProjectFromTemplateAndAccountRequest extends CreateProjectRequest the request structure for creating projects from templates with certain data coming from an account. To be used with createProjectsFromTemplatesAndAccounts. This class extends CreateProjectFromTemplateService.CreateProjectRequest Properties
MethodsCreateProjectFromTemplateAndAccountRequestglobal CreateProjectFromTemplateAndAccountRequest(Id accountId, Id templateProjectId, Date startDate) A default constructor with minimum required properties. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code CreateProjectFromTemplateService.CreateProjectFromTemplateAndOpportunityRequestglobal with sharing class CreateProjectFromTemplateAndOpportunityRequest extends CreateProjectRequest the request structure for creating projects from templates with certain data coming from an opportunity. To be used with createProjectsFromTemplatesAndOpportunities. This class extends CreateProjectFromTemplateService.CreateProjectRequest Properties
MethodsCreateProjectFromTemplateAndOpportunityRequestglobal CreateProjectFromTemplateAndOpportunityRequest(Id opportunityId, Id templateProjectId, Date startDate) A default constructor with minimum required properties. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code CreateProjectFromTemplateService.CreateProjectResponseglobal class CreateProjectResponse the response structure returned for each request passed to createprojectsfromtemplates. Properties
MethodsisSuccessglobal Boolean isSuccess() Indicates whether the project was successfully created. Even if isSuccess() is false, it is possible that the project was still created. That can happen, for example, when the there was a problem creating a budget to link to the new project. CreateProjectFromTemplateService.CreateProjectErrorglobal with sharing class CreateProjectError stores error messages that occur when executing methods from createprojectfromtemplateservice. Properties
|